package com.ruoyi.comments.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.comments.mapper.TecaherCommentsMapper;
import com.ruoyi.comments.domain.TecaherComments;
import com.ruoyi.comments.service.ITecaherCommentsService;

/**
 * 学期评价Service业务层处理
 * 
 * @author yxy
 * @date 2024-10-26
 */
@Service
public class TecaherCommentsServiceImpl implements ITecaherCommentsService 
{
    @Autowired
    private TecaherCommentsMapper tecaherCommentsMapper;

    /**
     * 查询学期评价
     * 
     * @param commentId 学期评价主键
     * @return 学期评价
     */
    @Override
    public TecaherComments selectTecaherCommentsByCommentId(Long commentId)
    {
        return tecaherCommentsMapper.selectTecaherCommentsByCommentId(commentId);
    }

    /**
     * 查询学期评价列表
     * 
     * @param tecaherComments 学期评价
     * @return 学期评价
     */
    @Override
    public List<TecaherComments> selectTecaherCommentsList(TecaherComments tecaherComments)
    {
        return tecaherCommentsMapper.selectTecaherCommentsList(tecaherComments);
    }

    /**
     * 新增学期评价
     * 
     * @param tecaherComments 学期评价
     * @return 结果
     */
    @Override
    public int insertTecaherComments(TecaherComments tecaherComments)
    {
        return tecaherCommentsMapper.insertTecaherComments(tecaherComments);
    }

    /**
     * 修改学期评价
     * 
     * @param tecaherComments 学期评价
     * @return 结果
     */
    @Override
    public int updateTecaherComments(TecaherComments tecaherComments)
    {
        tecaherComments.setCreateTime(new Date());
        return tecaherCommentsMapper.updateTecaherComments(tecaherComments);
    }

    /**
     * 批量删除学期评价
     * 
     * @param commentIds 需要删除的学期评价主键
     * @return 结果
     */
    @Override
    public int deleteTecaherCommentsByCommentIds(Long[] commentIds)
    {
        return tecaherCommentsMapper.deleteTecaherCommentsByCommentIds(commentIds);
    }

    /**
     * 删除学期评价信息
     * 
     * @param commentId 学期评价主键
     * @return 结果
     */
    @Override
    public int deleteTecaherCommentsByCommentId(Long commentId)
    {
        return tecaherCommentsMapper.deleteTecaherCommentsByCommentId(commentId);
    }

    /**
     * 根据studentid查询评论
     * @param studentid
     * @return
     */
    @Override
    public List<TecaherComments> selectTecaherCommentsListBystudentid(String studentid) {
        return tecaherCommentsMapper.selectTecaherCommentsListBystudentid(studentid);
    }

    @Override
    public List<TecaherComments> selectTecaherCommentsListByteacherId(String teacherId) {
        return tecaherCommentsMapper.selectTecaherCommentsListByteacherId(teacherId);
    }

    @Override
    public TecaherComments selectTecaherCommentsByCommentIdandDate(String studentId, String termId) {
        return tecaherCommentsMapper.selectTecaherCommentsByCommentIdandDate(studentId,termId);
    }
}
